<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<title></title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
		#content{
			height: 1200px;
			width: 300px;
			border: 1px solid red;
		}
		a{
			
			position: fixed;
			right: 0px;
			bottom: 0px;

		}
	</style>
</head>
<body>
<div id="content">
	<a href="javascript:gotop();">top</a>
</div>
<script type="text/javascript">


document.body.onscroll = function () {
	
	document.title = document.body.scrollTop;
}

// function gotop() {
// 	// body...
// 	document.body.scrollTop = 0;
// }
</script>
</body>
</html>